#include <iostream>
#include <string>
#include "StopWatch.h"
#include "Statistic.h"
#include "MostFrecWord.h"
#include "Recfunc.h"
using namespace std;
using namespace U31;
using namespace U32;
using namespace U33;


int main()
{
	// Uppg 1 //

	Recfunc rFunc;
	int sum = 0;

	cout << rFunc.itterativ_sum(17) << endl;
	cout << rFunc.Recfunc_sum(17,sum) << endl;
	cout << "**********************************************" << endl << endl;


	

	// Uppg 2 //
	CStopWatch Clock;
	Statistic S1;

	Clock.Start();
	S1.readFromFile();
	S1.group_by_sal(0);
	

	cout << "Mean is " << S1.calculate_mean() << endl; 

	cout << "25p is " << S1.percentile(0.25) << endl;
	cout << "50p is " << S1.percentile(0.50) << endl;
	cout << "75p is " << S1.percentile(0.75) << endl;
	cout << "90p is " << S1.percentile(0.90) << endl;

	S1.clear_vector();
	Clock.Stop();
	
	cout << "Time taken = " << Clock.GetDuration() << endl;
	cout << "*********************************************" << endl;

	

	// Uppg 3 //

	MostFrecWord MFW;
	string Word;
	int SumOfWord;

	MFW.readFromFile();
	SumOfWord = MFW.MaxWord(Word);
	
	cout << " Most Frequent Word is " << Word << " it was present " << SumOfWord << " times" << endl;  

	MFW.add_to_queue();
	MFW.Print_list();


	system("Pause");
	return 0;



}